package com.qk.management.service.listener;

import com.qk.common.constants.AvatarMessageConstants;
import com.qk.common.event.CleanupCompletedEvent;
import com.qk.common.event.EventListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class CleanupCompletionListener implements EventListener<CleanupCompletedEvent<?>> {
    
    @Override
    public void onEvent(CleanupCompletedEvent<?> event) {
        log.info("{} - {}: {}, {}: {}, {}: {}", 
                AvatarMessageConstants.CLEANUP_COMPLETION_NOTIFICATION,
                AvatarMessageConstants.CLEANUP_TARGET_TYPE, event.getTargetType(), 
                AvatarMessageConstants.CLEANUP_SUCCESS_COUNT, event.getSuccessCount(), 
                AvatarMessageConstants.CLEANUP_FAILURE_COUNT, event.getFailureCount(),
                AvatarMessageConstants.CLEANUP_TOTAL_COUNT, event.getCleanedItems().size());
    }
}